import {http} from "@/interceptor/luch-request/index.js"
// 创建职工
export const saveStaff = (data) => {
    return http.post("api/admin/staff/v1/saveStaff", data,{
	header:{
			"content-type": "application/json"
		}
	});	
}
// 职工列表
export const pageStaff = (data) => {
	return http.get("api/admin/staff/v1/pageStaff", {
		data: data
	});
}
// 获取普通职工角色
export const getOne = (data) => {
	return http.get("api/admin/basicRole/v1/getOne", {
		data: data
	});
}
 // 删除职工
export const gradeDelete = (data) => {
    return http.delete("api/admin/staff/v1/deleteStaff",data,{
		header:{
			"content-type": "application/json"
		}
	});	
}
 
// 编辑职工
export const updateStaff = (data) => {
    return http.put("api/admin/staff/v1/updateStaff",data,{
		header:{
			"content-type": "application/json"
		}
	});	
} 

// 回复职工
export const backEmployment = (data) => {
    return http.put("api/admin/staff/v1/backEmployment",data,{
		header:{
			"content-type": "application/json"
		}
	});	
}

// 职工详情
export const infoStaff = (id) => {
    return http.get("api/admin/staff/v1/infoStaff/" + id,{
        header: {
            "content-type": "application/x-www-form-urlencoded",
        }
    });
}

// 职工离园
export const leaveStaff = (data) => {
    return http.put("api/admin/staff/v1/leaveStaff",data,{
		header:{
			"content-type": "application/json"
		}
	});	
}

// 导入职工
export const readStaff = (data) => {
    return http.post("api/admin/staff/v1/read", data,{
	header:{
			"content-type": "application/json"
		}
	});	
}


// 重置密码
export const resetPwd = (id) => {
    return http.post("api/admin/staff/v1/resetPwd/" + id,{
        header: {
            "content-type": "application/x-www-form-urlencoded",
        }
    });
}

// 所有人列表
export const listAllStaff = (data) => {
	return http.get("api/admin/staff/v1/listAllStaff", {
		data: data
	});
}
// 修改密码
export const staffPwd = (data) => {
    return http.put("api/admin/staff/v1/update/staffPwd",data,{
		header:{
			"content-type": "application/json"
		}
	});	
}
// 职工考勤
export const hikSingleToken = (data) => {
    return http.get("api/app/hik/v1/hikSingleToken",  {
		data: data
	});	
}